<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title><?php echo ($title); ?></title>
	<link rel="stylesheet" href="/Public/Home/css/general.css">
	<link rel="stylesheet" href="/Public/Home/css/layout.css">
	<link rel="stylesheet" href="/Public/Dist/css/bootstrap.min.css">
	<link rel="stylesheet" href="/Public/Home/css/login-style.css">

	<!-- 可选的Bootstrap主题文件（一般不用引入） -->
	<link rel="stylesheet" href="/Public/Dist/css/bootstrap-theme.min.css">
	<!-- page css-->
	<link rel="stylesheet"type="text/css" href="/Public/css/page.css">

	<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
	<script src="/Public/Dist/js/jquery.min.js"></script>

	<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
	<script src="/Public/Dist/js/bootstrap.min.js"></script>
	<script src="/Public/js/function.js"></script>
	<style>
		#foot .android{
			background:url("/Public/Home/Image/android.gif") no-repeat 0px 9px;
		}
		#foot .iphone{
			background:url("/Public/Home/Image/iphone.gif") no-repeat 0px 9px;
		}
		#foot .winphone{
			background:url("/Public/Home/Image/wp7.gif") no-repeat 0px 9px;
		}
	</style>
	
	

</head>
<body>
	<div class="container" style="width:100%">
	  	<div class="row" id="head">
	    	<div  class="col-md-10 col-md-offset-1 head_content">	
				<div class="head_left fl">
					<ul>
						<li><a href="#">首页</a></li>
						<li><a href="#">开源项目</a></li>
						<li><a href="#">首页</a></li>
						<li><a href="#">首页</a></li>
						<li><a href="#">首页</a></li>
						<li><a href="#">首页</a></li>
					</ul>
				</div>
				<div class="head_right fr">当前访客身份：游客 [ <?php if(empty($_SESSION['userinfo'])): ?><a href=''>登录</a>|<a href=''>加入开源中国</a>
					<?php else: ?>
						<a href=''><?php echo ($_SESSION['userinfo']['name']); ?></a>|<a href=''>注销</a><?php endif; ?>]
				</div>
			</div>	
	    </div>
	    <div class="row" id="search">
		    <div class="col-md-10 col-md-offset-1">
		    	<div class="row">
	<div class="col-md-8">
		<div class="row">
			<div class="col-md-3 logo" >
				
			</div>
			<div class="col-md-9">
				<ul>
					<li class="fl">1 <img src="" alt="">	</li>
					<li class="fl">2 <img src="" alt=""></li>
					<li class="fl">3 <img src="" alt=""></li>
				</ul>
			</div>
		</div>
	</div>
	<div class="col-md-4">
		<form action="" class="fr">
			<input type="text" name="content" placeholder="资讯、软件、分享、代码、博客" class="form-text">
			<input type="submit" value="搜索" class="form-submit">
		</form>
	</div>
</div>
		    </div>	
			
	    </div>
	    <div class="row ">
		    <div class="col-md-10 col-md-offset-1" style="margin-top:20px;margin-bottom:20px;">
		    	
	<div class="col-md-4 col-md-offset-4 form-register">
		<form role="form" id="register-form" action="<?php echo U('doregister');?>" method="post">
		  	<div class="form-group">
		    	<label for="exampleInputUsername">用户名</label>
		    	<input type="text" class="form-control" name="username" id="exampleInputUsername" placeholder="用户名"
					   data-container="body" data-toggle="popover" data-placement="right" data-content="用户名">
		  	</div>
		  	<div class="form-group">
		    	<label for="exampleInputEmail">Email</label>
		    	<input type="email" class="form-control" name="email" id="exampleInputEmail" placeholder="Email"
					   data-container="body" data-toggle="popover" data-placement="right" data-content="email">
		  	</div>
		  	<div class="form-group">
		    	<label for="exampleInputPassword1">密码</label>
		    	<input type="password" class="form-control" name="password" id="exampleInputPassword1" placeholder="密码"
					   data-container="body" data-toggle="popover" data-placement="right" data-content="密码格式">
		  	</div>
		  	<div class="form-group">
		    	<label for="exampleInputPassword2">确认密码</label>
		    	<input type="password" class="form-control" name="repassword" id="exampleInputPassword2" placeholder="确认密码"
					   data-container="body" data-toggle="popover" data-placement="right" data-content="两次输入的密码不一致">
		  	</div>

		  	<button type="submit" class="btn btn-info">注&nbsp;&nbsp;册</button>
		</form>
		<script>
			$(function(){
				var regForm = $('#register-form');
				var password2 = $('#exampleInputPassword2');
				var username = $('#register-form #exampleInputUsername');
				var password = $('#register-form #exampleInputPassword1');
				var email = $('#register-form #exampleInputEmail');
				password2.change(function(){
					if(password.val()!==password2.val()){
						password2.popover('show');
					}
				});

				togglePopover(username,/^[\u4E00-\u9FA5a-zA-Z0-9_]{3,20}$/,'用户名格式不正确');
				togglePopover(email,/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,'邮箱格式不正确');
				togglePopover(password,/^[a-zA-Z]\w{5,17}$/,'密码格式不正确');
				regForm.submit(function(){

					var resUserName = checkRule(username,/^[\u4E00-\u9FA5a-zA-Z0-9_]{3,20}$/);
					if(!resUserName){
//						popMSG('用户名格式','用户名含有特殊字符');
						return false;
					}
					var resPassWord = checkRule(password,/^[a-zA-Z]\w{5,17}$/);
					if(!resPassWord){
						popMSG('密码格式','以字母开头，只能包含字符、数字和下划线的6-18个字符');
						return false;
					}
					var resEmail = checkRule(email,/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/);
					if(!resEmail){
						popMSG('Email格式','Email格式不正确');
						return false;
					}
				});
			})
		</script>
	</div> 
	<!--<div class="col-md-4">-->
		<!--<div class="row">
	<div class="col-md-12">
		<div style="background:#40AA53;height:30px;border-radius:3px; ">
			<img src="1" alt=""><b style="margin:auto 10px;line-height:30px;font-size: 11.5pt;color: #fff;">热门文章</b>
		</div>
		<ul>
			<li><img src="1" alt="">1</li>
			<li><img src="1" alt="">1</li>
			<li><img src="1" alt="">1</li>
		</ul>
	</div>
</div>-->
	<!--</div>-->

				<?php if(!empty($popMSG)): ?><script>
						popMSG( '<?php echo $popMSG['title'] ?>','<?php echo $popMSG['msg'] ?>' );
					</script>
					<?php else: ?>
					<?php if(!empty($_GET['msgTitle'])&& !empty($_GET['msgContext'])){?>
					<script>
						popMSG( '<?php echo $_GET['msgTitle'] ?>','<?php echo $_GET['msgContext'] ?>' );
					</script>
					<?php } endif; ?>
		    </div>
			
			<div class="row">	
				<div class="col-md-10 col-md-offset-1" id="foot">
					<div class="row">
						<div class="foot_left col-md-8">
							© 开源中国(OSChina.NET) | <a href="">关于我们</a> | <a href="">广告联系</a> | <a href="">@新浪微博</a> | <a href="">开源中国手机版</a> | 粤ICP备12009483号-3
						</div>
						<div class="foot_right col-md-4">
							<div class="fr">
								<div class="fl">开源中国手机客户端：<a class="icon-phone fl android" href=""></a><a class="icon-phone fl iphone" href=""></a><a class="icon-phone fl winphone" href=""></a></div>
								<div class="clear"></div>
							</div>
							
						</div>
						<div class="row">
							<div class="col-md-12 foot_bottom">
								开源中国社区(OSChina.net)是工信部 <a href="">开源软件推进联盟</a> 指定的官方社区
							</div>
						</div>
					</div>
				</div>
			</div>
	    </div>
	</div>
	<div class="clear"></div>	
</body>
</html>